/*
 * @Author       : xinbaiyu
 * @Version      : V1.0
 * @Date         : 2025-03-03 17:28:02
 * @Description  : 声明不同组件传参的类型
 */
import { defineExtensionMessaging } from '@webext-core/messaging';

interface ProtocolMap {
  getStringLength(s: string): number;
  uploadFile(data: {
    fileRaw: File
    config: RuleForm
  }): any;
  askAi(data: {
    text: string
    config: RuleForm
  }): any;
  submitEvent(data: {
    config: RuleForm
  }): any;
}

export const { sendMessage, onMessage } = defineExtensionMessaging<ProtocolMap>();